<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{pageTitle}</title>
<link rel="stylesheet" type="text/css" href="template/default.css" />
<link rel="stylesheet" type="text/css" href="default.css" />
<script src="js/jquery/jquery.js" type="text/javascript"></script>
<script src="js/script.js" type="text/javascript"></script>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
function adminAndDel(a){
	var truthBeTold = window.confirm("Click \"确定\" to confirm, or \"取消\" to cancel");
	if (truthBeTold) {
		self.location = a;
	}  else window.alert("Operation Cancel!");
}
function logout()
{
	document.getElementByID("links").submit;
}
function pDisplaySwitch(a)
{	
	a_s = document.getElementById(a).style.display;
	if(a_s == "" || a_s == "block"){
		document.getElementById(a).style.display = "none";
	} else if(a_s == "none"){
		document.getElementById(a).style.display = "";
		document.getElementById(a).style.display = "block";
	}
}
function show(a)
{	
	document.getElementById(a).style.display = "";
	document.getElementById(a).style.display = "block";
}
function hide(a)
{	
	document.getElementById(a).style.display = "none";
}
function check(){
	if(document.getElementById("search_term").value==""){
		alert("Please input your search term.");
		return false;
	} else {
		return true;
	}
}
function submitRating(evt)
{
	var tmp = evt.target.getAttribute('id').substr(5);
	var ip = "{ip}";
	var uid = "{user_id}";
	var widgetId = tmp.substr(0, tmp.indexOf('_'));
	var ownerType = widgetId.substr(0,1);
	var ratingType = widgetId.substr(1,1);
	var ownerId =  widgetId.substr(2,widgetId.length - 2);
	var starNbr = Number(tmp.substr(tmp.indexOf('_')+1)) + 1;
	$.get("./rating_submit.php",
    	{
			ratingType: ratingType, 
			ownerType: ownerType,
			ownerId: ownerId, 
			ip: ip, 
			userId: uid,
			value: starNbr
		},
    	function(data){
			alert(data);
			if(data == "Thank you for rating!"){
				window.location.reload(true);
			}
		}
    );
}
function jqueryInit()
{
	init_rating();
	$('div.rating/img').bind('click', submitRating);
}
function redirect(a){
	self.location = "document.php?id=" + a;
}
$(document).ready(jqueryInit);
</script>
</head>
<body>
{user_session}
<div id="container">
<h1>{title}</h1>
<div id="document_info">
Id: {d_id}
&nbsp;&nbsp; Status: {status} 
&nbsp;&nbsp; Creator: [<a href="{creator_link}">{creator}</a>]
&nbsp;&nbsp; Update Time:{update_time}<br />
<div class="{rating_display_class}">
<a class="tooltips" href="#tooltips">RA:<span>Informative rating</span></a>
<div class="{rating_class}" id="{rating_a_id}">{rating_a_value}</div>
   <a class="tooltips" href="#tooltips">RB:<span>Structural rating</span></a>
<div class="{rating_class}" id="{rating_b_id}">{rating_b_value}</div>
</div>
</div>

<h3>Paragraph</h3>
<ul class="paragraph">
<!-- BEGIN pr_list -->
	<li class="paragraph">
	<div class="pr_option">
		<!--{pr_update_time}-->
		{pr_options}
	</div>
	<!-- BEGIN p_list -->
		<div class="{p_header_style_class}" onclick="pDisplaySwitch('{p_id}')">[<a href="{p_author_link}">{p_author}</a>]@{p_update_time}&nbsp;&nbsp;&nbsp; <a class="tooltips" href="#tooltips">RA:<span>Informative rating</span></a>
			<div class="{rating_class}" id="{p_rating_a_id}">{p_rating_a_value}</div>
			   <a class="tooltips" href="#tooltips">RB:<span>Structural rating</span></a>
			<div class="{rating_class}" id="{p_rating_b_id}">{p_rating_b_value}</div>
		</div>
		<div class="{p_style_class}" style="{p_style_modifier}" id="{p_id}">
			<div class="p_content_v">
				{p_content}
			</div>
			<div class="p_keys">
				<h3 class="p_keys_title">
					[<a onmouseover="show('{p_ref_id}');hide('{p_internal_link_id}');hide('{p_talk_id}')">Refs</a>]
					[<a onmouseover="hide('{p_ref_id}');show('{p_internal_link_id}');hide('{p_talk_id}')">Internel Links</a>]
					[<a onmouseover="hide('{p_ref_id}');hide('{p_internal_link_id}');show('{p_talk_id}')">Talks</a>]
					Options-&gt; {p_options}
				</h3>
				<ul class="p_keys" id="{p_ref_id}" style="display:none">
					<!-- BEGIN p_ref_list -->
					<li class="p_keys_content">{p_ref}</li>
					<!-- END p_ref_list -->
					<li class="cleaner"></li>
				</ul>
				<ul id="{p_internal_link_id}" style="display:none" class="p_keys">
					<!-- BEGIN p_internal_link_list -->
					<li class="p_keys_content"><a href="{p_internal_link_url}">[{p_internal_link_title}]</a></li>
					<!-- END p_internal_link_list -->
					<li class="cleaner"></li>
				</ul>
				<ul class="p_keys" id="{p_talk_id}" style="display:none" >
					<!-- BEGIN p_talk_list -->
					<li class="p_talk">{p_talk_content}
					<br />&nbsp;&nbsp;&nbsp;&nbsp;--by [<a href="{p_talk_author_link}">{p_talk_author}</a>]@{p_talk_time}
					<br />
					<a class="tooltips" href="#tooltips">RA:<span>Informative rating</span></a>
					<div class="{rating_class}" id="{p_talk_rating_a_id}">{p_talk_rating_a_value}</div>
					   <a class="tooltips" href="#tooltips">RB:<span>Structural rating</span></a>
					<div class="{rating_class}" id="{p_talk_rating_b_id}">{p_talk_rating_b_value}</div> 
					   {p_t_options}
					</li>
					<!-- END p_talk_list -->
				</ul>
			</div>
		</div>
		<div class="{p_close_style_class}"></div>
	<!-- END p_list -->
	
	</li>
	<li class="cleaner"></li>
<!-- END pr_list -->
</ul>
<h3>Talk</h3>
<ul class="talk">
	<!-- BEGIN talk_list -->
	<li class="p_talk">{talk_content}<br />&nbsp;&nbsp;&nbsp;&nbsp;--by [<a href="{talk_author_link}">{talk_author}</a>]@{talk_time}
	<br />
	<a class="tooltips" href="#tooltips">RA:<span>Informative rating</span></a>
	<div class="{rating_class}" id="{talk_rating_a_id}">{talk_rating_a_value}</div>
	   <a class="tooltips" href="#tooltips">RB:<span>Structural rating</span></a>
	<div class="{rating_class}" id="{talk_rating_b_id}">{talk_rating_b_value}</div> 
	   {t_options}
	</li>
	<!-- END talk_list -->
</ul>
<h3>Child Node</h3>
<ul class="links">
	<!-- BEGIN child_list -->
	<li class="links">[<a href="{child_url}">{child_title}</a>]</li>
	<!-- END child_list -->
</ul>
<h3>Parent Node</h3>
<ul class="links">
	<li class="links">[<a href="{father_url}">{father_title}</a>]</li>
</ul>
<h3>Options</h3>
<div id="d_option">{options}</div>
</div>
<div id="search_bar">
<h3>Search</h3>
<form action="search_result.php" method="post" onsubmit="return check();">
	<input id="search_term" name="term" type="text" size="30" onkeyup="value=value.replace(/[^\u4E00-\u9FA5a-z0-9A-Z]/g,'')"/>
	<input type="submit" value="Search Title" />
</form>
</div>
<div id="nav">
  <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="300">
    <param name="movie" value="/eka/swf/solar_system.swf?id={d_id}&src=/eka/data/tree.php?key={currentTime}" />
    <param name="quality" value="high" />
    <param name="wmode" value="transparent" />
    <param name="swfversion" value="6.0.65.0" />
    <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
    <param name="expressinstall" value="Scripts/expressInstall.swf" />
    <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="/eka/swf/solar_system.swf?id={d_id}&src=/eka/data/tree.php?key={currentTime}" width="300" height="300">
      <!--<![endif]-->
      <param name="quality" value="high" />
      <param name="wmode" value="transparent" />
      <param name="swfversion" value="6.0.65.0" />
      <param name="expressinstall" value="Scripts/expressInstall.swf" />
      <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
      <div>
        <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
        <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
      </div>
      <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
  </object>
</div>
<div id="events">{new_events}</div>
{footer}
</body>
</html>